<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('查看邮件')" />
<th:block th:include="include :: list-css" />
<style type="text/css">
	.layui-form-radio{margin-top: 0}
	.layui-form-item{text-align: unset}
	.getUpload {cursor: pointer;height: 22px;display: block;margin-top: 4px;}
	.box11{background:#fffdfd;border-radius:10px;margin:10px;}
	.shadow{position:relative;box-shadow:0 1px 4px rgba(0,0,0,.3),0 0 20px rgba(0,0,0,.1) inset}
	.shadow::after,.shadow::before{content:"";position:absolute;z-index:-1;bottom:26px;left:10px;width:50%;height:20%;box-shadow:0 15px 10px rgba(0,0,0,.7);transform:rotate(-3deg)}
	.shadow::after{right:10px;left:auto;transform:rotate(3deg)}

	.btn-list {height: auto;text-align: left;padding: 5px 0 5px 28px;margin: 0}
	.content-head{height:auto;text-align: left;padding:0 0 0 30px;margin-top:0;background: #f3f1f1;border-top: 1px solid #8BA7CC;border-bottom: 1px solid #8BA7CC;}
	.mailContent{overflow-y: scroll;padding: 0 15px;}
	.content-head{padding-top: 4px}
	.content-head p{margin: 4px 0;}
</style>
</head>
<body>
<div class="main-content">
	<div class="shadow box11">
		<form class="layui-form" action="">
			<input type="hidden" id="nid" th:value="${mailContent['fileMark']}">
			<div class="layui-form-item btn-list" style="border-radius:10px 10px 0 0 ;">
				<div class="layui-btn layui-btn-warm layui-table-tools" onclick="history.go(-1)"><p class="dhicon dh-chevron-left" style="color:white;font-size:14px"><span class="fa_span">返 回</span></p></div>
				<div class="layui-btn layui-btn-normal layui-table-tools" onclick="replyMail()"><p class="dhicon dh-mail-reply" style="color:white;font-size:14px"><span class="fa_span">回 复</span></p></div>
				<div class="layui-btn layui-table-tools" onclick="transportMail()"><p class="dhicon dh-external-link" style="color:white;font-size:14px"><span class="fa_span">转 发</span></p></div>
				<div class="layui-btn layui-btn-danger layui-table-tools" onclick="delMail()"><p class="dhicon dh-remove" style="color:white;font-size:14px"><span class="fa_span">删 除</span></p></div>
			</div>
			<div class="layui-form-item content-head">
				<b style="font-size: 15px;">
					<i class="dhicon dh-mailread" th:if="${mailContent.urgentDegree eq '普通'}" th:title="普通邮件" style="color: #0095e7;font-size: 18px;"></i>
					<i class="dhicon dh-mailread" th:if="${mailContent.urgentDegree eq '加急'}" th:title="加急邮件" style="color: #ffb800;font-size: 18px;"></i>
					<i class="dhicon dh-mailread" th:if="${mailContent.urgentDegree eq '特急'}" th:title="特急邮件" style="color: red;font-size: 18px;"></i>
					[[${mailContent['mailSubject']}]]
				</b>
				<span class="getUpload" onclick="getUpload('vHFilesDefault','Mail','',$('#fileFlag'));"><i class="dhicon dh-paperclip"></i> &nbsp;<font id="fileFlag">[[${mailContent['vHFilesDefault']}]]</font></span>
				<p th:text="'发件人：'+${mailContent['fromUserName']}+' ['+${mailContent['fromUser']}+']'"></p>
				<p>时间：[[${#dates.format(mailContent.sendTime, 'yyyy-MM-dd HH:mm:ss')}]]</p>
				<p>收件人：[[${mailContent['toUserName']}]]</p>
				<p th:if="${not #strings.isEmpty(mailContent.ccUserName)}">抄送人：[[${mailContent['ccUserName']}]]</p>
			</div>
			<div class="layui-form-item mailContent w-e-text">
			</div>
			<!--<div class="layui-form-item btn-list" style="border-radius: 0 0 10px 10px;">
				<div class="layui-btn layui-btn-warm layui-table-tools" onclick="history.go(-1)"><p class="dhicon dh-chevron-left" style="color:white;font-size:14px"><span class="fa_span">返 回</span></p></div>
				<div class="layui-btn layui-btn-normal layui-table-tools" onclick="replyMail()"><p class="dhicon dh-mail-reply" style="color:white;font-size:14px"><span class="fa_span">回 复</span></p></div>
				<div class="layui-btn layui-table-tools" onclick="transportMail()"><p class="dhicon dh-external-link" style="color:white;font-size:14px"><span class="fa_span">转 发</span></p></div>
				<div class="layui-btn layui-btn-danger layui-table-tools" onclick="delMail()"><p class="dhicon dh-remove" style="color:white;font-size:14px"><span class="fa_span">删 除</span></p></div>
			</div>-->
		</form>
	</div>
</div>

<script th:src="@{/js/jquery/jquery.min.js}"></script>
<script th:src="@{/js/jquery/jquery.cookie.js}"></script>
<script th:src="@{/js/layuiadmin-1.2.1/layui/layui.js?v=2}"></script>
<script th:src="@{/js/jquery/jquery.blockUI.min.js}"></script>
<script th:src="@{/dhecp/js/dh-common.js?v=53}"></script>
<script th:src="@{/dhecp/js/dh-ui.js?v=37}"></script>
<!--<script th:src="@{/js/layuiadmin-1.2.1/lib/extend/wangEditor/wangEditor.min.js}"></script>-->
<script th:inline="javascript">
/*<![CDATA[*/
var mailContent=[[${mailContent}]],
	fromPageType=[[${fromPageType}]],
	moduleTable=[[${moduleTable}]];
/*]]>*/
</script>
<script type="text/javascript">
	var fileBtnHide = 1;
	$(".mailContent").html(mailContent.mailContent);
	$(".box11").css('min-height',$(window).height()-54);
	$(".mailContent").css('height',$(window).height()-$(".content-head").height()-134);
	// $(".btn-list").css('background',parent.logo_color_rgba);
	// $(".btn-list").css('backgroundImage', "linear-gradient(to right,#359FD4,#36B5C8,#25D8AB)");
	var $,layer;
	layui.use(['layer','element','form'], function () {
		$ = layui.jquery,layer = layui.layer;
	});
	//未读转已读
	if(fromPageType=='inbox' && !mailContent.readed){
		$.post("/system/oamail/readedpost",{'infoItems':JSON.stringify([{guid:mailContent.guid,readed:1}])})
		//更新列表显示数量
		parent.refreshMail();
	}
	function delMail(){
		$.modal.confirmCom("您确认要删除邮件 [" + mailContent.mailSubject +']？',function(){
			$.operate.post("/system/oamail/deletedpost",{'infoItems':JSON.stringify([{guid:mailContent.guid,deleted:1,mailType:mailContent.mailType}])},function(result){
				if(result.code==0){
					setTimeout(function(){
						layer.closeAll();window.location.href = "/system/oamail/mailList?pageType="+fromPageType;
					}, 1000);
				}
			});
		});
	}
	function replyMail(){
		window.location.href = "/system/oamail/edit?pageType=reply&guid="+mailContent.guid+"&fromPageType="+fromPageType+"&mailType="+mailContent.mailType;
	}
	function transportMail(){
		window.location.href = "/system/oamail/edit?pageType=transport&guid="+mailContent.guid+"&fromPageType="+fromPageType+"&mailType="+mailContent.mailType;
	}
</script>
</body>
</html>